#include <bits/stdc++.h>
using namespace std;
int a[10001];

int main() {
	int n, r;
	cin >> n >> r;
	a[1] = r;
	for (int i = 0; i < n - 1; i++) {
		int x, y;
		cin >> x >> y;
		if (a[x])
			a[x * 2] = y;
		if (a[y])
			a[y * 2 + 1] = x;
	}
	for (int i = 1; i <= n; i++) {
		if (a[i] == 0) {
			cout << "no";
			return 0;
		}
	}
	cout << "yes";
	return 0;
}